Tutorials/Mount Eventing
It is common for RPGs to have mounts, animals that can be ridden. This guide will serve to explain how to implement a smooth mount system through simple eventing. Download Demo Usage Mounts can serve a variety of purposes in RPG games. In a game where overworld map is not utilized, it is useful to have a mount to speed up travel time along the roads. They can also be designed to allow passage through an otherwise impassable terrain. Different exotic animals can become rare mounts that are hard to obtain and serves as a bragging right. The eventing demonstrated here serves as a basis for customization and personalization. Event Analysis The mount system detailed in the demo is composed of various common events that runs on conditional checks. The first common event, HorseMount is essentially a variety of conditions that must be satisfied for the playable character to mount up. This event is set to parallel process based on a condition switch that is turned on at the beginning of the game. # Conditional Branch: Script $game_player.movable? checks if the player character is movable. This is necessary to prevent the character from mounting during Scenes where mounting should not be allowed. # Conditional Branch: Variable 0001:MountTimeVar >= 4 The MountTimeVar variable is increased by 1 every 15 frames (.25 seconds). This variable is used to prevent the user from mounting over and over again by holding down the button. Using this condition check, the player can only initiate one mount/dismount every 1 second. # Conditional Branch: 0003:NoMountZone OFF Certain indoor areas should prevent the player from mounting. If this switch is on, the player cannot mount. # Conditional Branch: of the Rider in Inventory This checks for a certain item to be in inventory in order for the mounting event to run. # Conditional Branch: Script: Input.press?(Input::Y) This is the button check. It checks if the button "S" is being pressed. # Conditional Branch: Variable 0002:WhichMount? 0 '''This checks for the variable of mount. In this demo, the variable is set so that 0 is horse, 1 is wolf, and 2 is a cow. Depending on which variable it is, the corresponding mounting event would be ran. The second part of the common event is the each individual riding processing. For this demo, this event has 3 different variations. One each for the horse, wolf and cow. Using the HorseMount(Horse) event as the example, # '''Conditional Branch: Switch0002:Mounted OFF This checks for the status of the character. If the character is not mounted, it will run the next part and proceed to mount up. ## Show Animation: Player, Mount1 This just displays the first part of the sparkly animation focusing on the player. ## Play SE: 'Horse' 80, 100 Plays the horse sound effect. ## Set Move Route: Player ### Change Speed: 5 Changes the speed of the player to reflect on the speed of the mount. ### Graphic 'Riding', 6 Changes the player's current graphic into the riding graphic. ## Script: $game_actors1.set_graphic("Riding", 6, $game_actors1.face_name, $game_actors1.face_index) '''This function changes the primary actor's graphic into that of the horse. The reason why this is necessary is because if this scriptcall was not ran, opening the menu and closing it would reset the player's graphic back to the non-riding form yet still retains the speed change from the mount. ## '''Show Animation: Player, Mount2 '''Displays the second part of the sparkly animation. ## '''Control Switches: 0002:Mounted = ON '''Changes the switch so that the player is now flagged as being on a mount. ## '''Control Variables: MountTimeVar = 0 Resets the MountTimeVar back to 0, so that the player cannot mount again until 1 second later. # Else : Conditional Branch: Switch0002:Mounted ON This part checks if the character is flagged as mounted. ## Show Animation: Player, Mount1 Display of sparkly animation. ## Set Move Route: Player ### Change Speed: 4 '''Changes the speed back to normal. ### '''Graphic 'Actor4', 2 Changes the player's current graphic back to the actor. ## $game_actors1.set_graphic("Actor4", 2, $game_actors1.face_name, $game_actors1.face_index) Changes the actor's system graphic back to normal. ## Show Animation: Player, Mount2 '''Displays the second part of the sparkly animation. ## '''Control Switches: 0002:Mounted = OFF Changes the switch so that the player is no longer flagged as being on a mount. ## Control Variables: MountTimeVar = 0 Resets the MountTimeVar back to 0, so that the player cannot mount again until 1 second later. The third common event is the event that counts the MountTimeVar. # Wait: 15 frame(s) '''Waiting .25 second. # '''Control Variables MountTimeVar += 1 Adding 1 every .25 second.